package quant.smart.crawl.task;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import quant.smart.crawl.domain.LmeService;

@Component
public class TaskEngine {
	
	@Autowired
	LmeService lmeService; 
	
	@Scheduled(fixedRate = 600000L)
	public void scheduleFixedRateTask() {
	    System.out.println("Fixed rate task - " + System.currentTimeMillis()/1000);
	    lmeService.collect();
	}

	/*@Scheduled(cron = "0 15 10 15 * ?")
	public void scheduleTaskUsingCronExpression() {
	    long now = System.currentTimeMillis() / 1000;
	    System.out.println("schedule tasks using cron jobs - " + now);
	}*/
}
